#include "Thread.hpp"
#include <iostream>
using namespace std;
#include <pthread.h>
#include <vector>
#include <unistd.h>
#include <stdio.h>
#include <memory>

void *thread_run(void *args)
{
    string name = static_cast<const char *>(args);
    
    while (1)
    {
        cout << "i am new process" << name << endl;
        sleep(1);
    }
    return nullptr;
}
int main()
{

    unique_ptr<Thread> t1(new Thread(thread_run, (void *)"hello", 1));
    unique_ptr<Thread> t2(new Thread(thread_run, (void *)"world", 2));

    t1->start();
    t2->start();


    t1->join();
    t2->join();
}